Skip to content

refactor(browser): type eval helper callbacks - #1616

Closed
jun0315 wants to merge 1 commit into
jackwener:mainfrom
jun0315:fix/browser-utils-typing
Closed

refactor(browser): type eval helper callbacks#1616
jun0315 wants to merge 1 commit into
jackwener:mainfrom
jun0315:fix/browser-utils-typing

Conversation

@jun0315

@jun0315 jun0315 commented May 16, 2026

Copy link
Copy Markdown
Contributor

Description

Tightens the internal browser eval helper callback type by reusing BrowserEvaluateFunction instead of a local any[] callback signature.

This keeps the existing runtime behavior unchanged while removing one small internal any usage.

  • Bug fix
  • ✨ New feature
  • New site adapter
  • Documentation
  • ♻️ Refactor
  • CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Screenshots / Output

npm test -- --project unit src/browser/utils.test.ts
Test Files  1 passed (1)
Tests       5 passed (5)

npm run typecheck -- --incremental false
passed

@jackwener

Copy link
Copy Markdown
Owner

Closing as superseded by current main. The core callback type tightening is already present on main via EvaluateFunction = (...args: never[]) => unknown, while public IPage.evaluate / implementations already expose BrowserEvaluateFunction<Args, T> at the call boundary. The remaining serializer-helper overloads do not change runtime behavior and conflict with current main. If there is still value in exposing helper-level overloads, please reopen as a fresh current-main PR with the concrete call-site benefit.

@jackwener jackwener closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants